<template>
  <div class="mainNav">
    <!-- <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" text-color="#000" active-text-color="#ef8200" :key = 1> -->
    <el-menu
      class="el-menu-demo"
      mode="horizontal"
      text-color="#000"
      active-text-color="#ef8200"
      :key="1"
    >
      <el-menu-item index="1">
        <router-link to="/guest/welcome" style="color:black;" class="manuItem">个人中心</router-link>
      </el-menu-item>
      <el-menu-item index="2">
        <router-link to="/guest/guestResumeReadOnly" style="color:black;" class="manuItem">履历表</router-link>
      </el-menu-item>
      <el-menu-item index="3">
        <router-link to="###" style="color:black;" class="manuItem">考勤</router-link>
      </el-menu-item>
      <el-menu-item index="4">
        <router-link to="/guest/pay" style="color:black;" class="manuItem">薪酬</router-link>
      </el-menu-item>
      <el-submenu index="5">
        <template slot="title">工作任务</template>
        <el-menu-item index="5-1">
          <router-link to="/guest/rdTask/list" class="subMenuItemColor">研发任务</router-link>
        </el-menu-item>
        <el-menu-item index="5-1">
          <router-link to="/guest/engineerTask/list" class="subMenuItemColor">工程任务</router-link>
        </el-menu-item>
        <el-menu-item index="5-1">
          <router-link to="/guest/administrativeTask/list" class="subMenuItemColor">行政任务</router-link>
        </el-menu-item>
        <el-menu-item index="5-1">
          <router-link to="/guest/bug/list" class="subMenuItemColor">BUG</router-link>
        </el-menu-item>
      </el-submenu>
      <!-- </el-menu-item>
                    <el-menu-item index="5">
                        <router-link to="###" style="color:black;" class="manuItem">工作任务</router-link>
      </el-menu-item>-->
      <el-submenu index="6">
        <template slot="title">物料</template>
        <el-menu-item index="6-1">
          <router-link to="###" class="subMenuItemColor">出入库管理</router-link>
        </el-menu-item>
        <el-menu-item index="6-2">
          <router-link to="###" class="subMenuItemColor">采购管理</router-link>
        </el-menu-item>
        <el-menu-item index="6-3">
          <router-link to="/guest/browse" class="subMenuItemColor">申请和领用</router-link>
        </el-menu-item>
      </el-submenu>
      <el-menu-item index="7">固定资产</el-menu-item>
      <el-menu-item index="8">
        <router-link to="/guest/noticeList" style="color:black;" class="manuItem">公告栏</router-link>
      </el-menu-item>
      <el-menu-item index="9">
        <router-link to="###" style="color:black;" class="manuItem">系统统计</router-link>
      </el-menu-item>

      <!-- 管理员 -->
      <!-- <el-submenu index="10" v-if = "getRoles.length > 0"> -->
      <el-submenu index="10">
        <template slot="title">后台管理</template>
        <el-submenu index="10-1">
          <template slot="title">人力资源</template>
          <el-submenu index="10-1-1">
            <template slot="title">用户基本信息</template>
            <el-menu-item index="10-1-1-1">
              <router-link to="/admin/users/list" class="subMenuItemColor">所有用户</router-link>
            </el-menu-item>
          </el-submenu>
          <el-menu-item index="10-1-2">
            <router-link to="/admin/structures/list" class="subMenuItemColor">组织架构管理</router-link>
          </el-menu-item>
          <el-menu-item index="10-1-3">
            <router-link to="/admin/position/list" class="subMenuItemColor">职位管理</router-link>
          </el-menu-item>
          <el-menu-item index="10-1-4">
            <router-link to="/admin/rank/list" class="subMenuItemColor">职业技能</router-link>
          </el-menu-item>
          <el-menu-item index="10-1-5">
            <router-link to="/admin/contractTempl/list" class="subMenuItemColor">合同模板</router-link>
          </el-menu-item>
        </el-submenu>

        <el-menu-item index="10-2">
          <router-link to="/admin/notice/list" style="color:black;" class="subMenuItemColor">公告管理</router-link>
        </el-menu-item>

        <el-submenu index="10-3">
          <template slot="title">工作任务管理</template>
          <el-submenu index="10-3-1">
            <template slot="title">研发任务</template>
            <el-menu-item index="10-3-1-1">
              <router-link to="/admin/proAnaly/List" class="subMenuItemColor">立项分析</router-link>
            </el-menu-item>
            <el-menu-item index="10-3-1-2">
              <router-link to="/admin/pro/list" class="subMenuItemColor">项目列表</router-link>
            </el-menu-item>
            <el-menu-item index="10-3-1-3">
              <router-link to="/admin/proInner/list" class="subMenuItemColor">项目内测</router-link>
            </el-menu-item>
          </el-submenu>
          <el-submenu index="10-3-2">
            <template slot="title">工程任务</template>
            <el-menu-item index="10-3-2-1">
              <router-link to="/admin/engineer/check" class="subMenuItemColor">项目验收</router-link>
            </el-menu-item>
            <el-menu-item index="10-3-2-2">
              <router-link to="/admin/engineer/trialProduction" class="subMenuItemColor">试生产</router-link>
            </el-menu-item>
            <el-menu-item index="10-3-2-3">
              <router-link to="/admin/engineer/exception" class="subMenuItemColor">异常处理</router-link>
            </el-menu-item>
            <el-menu-item index="10-3-2-4">
              <router-link to="/admin/engineer/jig" class="subMenuItemColor">治具</router-link>
            </el-menu-item>
          </el-submenu>
          <el-submenu index="10-3-3">
            <template slot="title">行政任务</template>
            <el-menu-item index="10-3-3-1">
              <router-link to="/admin/adminAministrative/design" class="subMenuItemColor">设计任务</router-link>
            </el-menu-item>
            <el-menu-item index="10-3-3-2">
              <router-link to="/admin/adminAministrative/sampleTest" class="subMenuItemColor">样品测试</router-link>
            </el-menu-item>
            <el-menu-item index="10-3-3-3">
              <router-link to="/admin/adminAministrative/makingTender" class="subMenuItemColor">标书制作</router-link>
            </el-menu-item>
            <el-menu-item index="10-3-3-4">
              <router-link to="/admin/adminAministrative/rdAccident" class="subMenuItemColor">研发事故</router-link>
            </el-menu-item>
          </el-submenu>
          <el-submenu index="10-3-4">
            <template slot="title">BUG处理</template>
          </el-submenu>
        </el-submenu>

        <el-submenu index="10-4">
          <template slot="title">物料管理</template>
          <el-menu-item index="10-4-1">
            <router-link to="/Materiel/list" class="subMenuItemColor">管理员</router-link>
          </el-menu-item>
          <el-menu-item index="10-4-2">
            <router-link to="/Materiel/warehouse" class="subMenuItemColor">物料管理</router-link>
          </el-menu-item>
          <el-menu-item index="10-4-3">
            <router-link to="/Materiel/supplier" class="subMenuItemColor">供应商管理</router-link>
          </el-menu-item>
          <!--<el-menu-item index="10-4-4"><router-link to="" class="subMenuItemColor">采购管理</router-link></el-menu-item>
          <el-menu-item index="10-4-5"><router-link to="" class="subMenuItemColor">售后管理</router-link></el-menu-item>-->
        </el-submenu>
        <el-menu-item index="10-5">
          <router-link to="/admin/permission/index" class="subMenuItemColor">权限管理</router-link>
        </el-menu-item>
        <el-menu-item index="10-6">
          <router-link to="/admin/workflow/index" class="subMenuItemColor">流程管理</router-link>
        </el-menu-item>
      </el-submenu>
      <el-submenu index="11">
        <template slot="title">天猫后台</template>
        <el-submenu index="11-1">
          <template slot="title">天猫管理</template>
          <el-menu-item index="11-1-1">
            <router-link to="/tmail/tmail/list" class="subMenuItemColor">天猫产品</router-link>
          </el-menu-item>
        </el-submenu>
      </el-submenu>
    </el-menu>
    <div class="line"></div>
  </div>
</template>

<script>
import { mapGetters } from "vuex";
export default {
  data() {
    return {
      activeIndex: "1"
    };
  },
  created() {},
  mounted() {},
  computed: {
    ...mapGetters([
      //  用户权限
      "getIsAdmin",
      "getRoles"
    ])
  },
  methods: {
    // handleSelect(key, keyPath) {
    //     let routerPath = ''
    //     switch(key){
    //         case '1':
    //             routerPath = '/guest/welcome'
    //             break
    //         case '2':
    //             routerPath = '/guest/guestResumeReadOnly'
    //             break
    //         case '4':
    //             routerPath = '/guest/pay'
    //             break
    //         case '8':
    //             routerPath = '/guest/noticeList'
    //         break
    //                     // case 3:
    //         //     routerPath = '/admin/welcome'
    //         //     break
    //         // case 5:
    //         //     routerPath = '/admin/welcome'
    //         //     break
    //         // case 6:
    //         //     routerPath = '/admin/welcome'
    //         //     break
    //         // case 7:
    //         //     routerPath = '/admin/welcome'
    //         //     break
    //     }
    //     this.$router.push(routerPath)
    // }
  }
};
</script>

<style scoped>
/* 线 */
.line {
  height: 2px;
  background-color: #ef8200;
}

/* .manuItem{
    padding:0 20px 20px 20px;
}*/

.manuItem:hover {
  color: #ef8200 !important;
}
.el-menu-demo a.manuItem {
  display: inline-block;
  height: 36px;
  line-height: 30px;
}
</style>


